home *** CD-ROM | disk | FTP | other *** search
- Path: rover.ucs.ualberta.ca!alberta!davidb
- From: davidb@cs.ualberta.ca (David Mccaughan)
- Newsgroups: comp.lang.c
- Subject: Re: File Size in bytes.
- Date: 23 Jan 1996 23:10:20 GMT
- Organization: Computing Science, U of Alberta, Edmonton, Canada
- Message-ID: <4e3pss$1os@scapa.cs.ualberta.ca>
- References: <4e0r59$733@hammerhead.dadd.ti.com>
- NNTP-Posting-Host: sawnlk.cs.ualberta.ca
- X-Newsreader: TIN [version 1.2 PL2]
-
- Sudheer Vemulapalli (sudheer@dadd.ti.com) wrote:
-
- : Is there a simple way to find the exact size of a file.I would like to know of
- : a way to do it other than using ls -l and getting the size field from the
- : output. If there is a UNIX system call or somefunction that returns the file
- : size please let me know.
-
- Although this really isn't a C question specifically, check the man page for
- fstat() or stat(). These function read the file's i-node into a data
- structure, one field of which is the size of the file in bytes.
-
- ----------------------------------------------------------------------------
- David B. McCaughan Department of Computing Science
- davidb@cs.ualberta.ca University of Alberta
- http://web.cs.ualberta.ca/~davidb Alberta, CANADA
- --------------------------------------------------------------------
- "If you love something, write it in C; if it compiles, it is yours; if it
- doesn't, it never was."
- ----------------------------------------------------------------------------
-